# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: ThatOneCalculator <kainoa@t1c.dev>

pkgname=hyprpaper
pkgver=0.2.0
pkgrel=1
pkgdesc='a blazing fast wayland wallpaper utility with IPC controls'
arch=(loong64 x86_64)
url="https://github.com/hyprwm/$pkgname"
license=(BSD)
depends=(cairo
         libglvnd
         libjpeg
         pango
         wayland)
makedepends=(cmake
             wayland-protocols
             xorgproto)
_archive="$pkgname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('20c71db247c54480f5187b77b2b24cb11ec4c53ee599bd7d777f1fccdb344b5f')

build() {
	cd "$_archive"
	cmake \
		--no-warn-unused-cli \
		-G "Unix Makefiles" \
		-D CMAKE_BUILD_TYPE=Release \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-B build
	make protocols
	make -C build all
}

package() {
	cd "$_archive"
	install -Dm0755 -t "$pkgdir/usr/bin/" "build/$pkgname"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
